{include file="public/common" /}

<form class="layui-form" action="" style="padding:5px" id="seller_goods_form">
    <input type="hidden" name="goods_id" value="{$goods_id}">
    <div class="layui-form-item">
        <label class="layui-form-label">商品名称（￥）</label>
        <div class="layui-input-inline">
            <input type="text"class="layui-input" name="" value="{$goods_data.goods_name}" disabled>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">商品价格（￥）</label>
        <div class="layui-input-inline">
            <input type="number"class="layui-input sum_price" name="" value="{$goods_data.price}" disabled>
        </div>
    </div>

    <div class="layui-form-item" name="goods_category_select">
        <div class="layui-inline">
            <label class="layui-form-label">审核状态</label>
            <div class="layui-input-block">
                <select name="goods_status" lay-filter="goods_one_category">
                    <option value="1" style="font-size:15px;" {if condition="$goods_data.status==1"}selected{/if}>审核通过</option>
                    <option value="2" style="font-size:15px;" {if condition="$goods_data.status==2"}selected {/if}>未通过</option>
                    <option value="3" style="font-size:15px;" {if condition="$goods_data.status==3"}selected {/if}>下架</option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="submit_">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script>
    $(function () {
        layui.use('layedit', function () {
            layedit = layui.layedit
                    , $ = layui.jquery;
            layedit.set({
                uploadImage: {
                    url: '/index/tool/layui_upload', //接口url
                    type: 'post'//默认post
                }
            });
            //构建一个默认的编辑器
            index = layedit.build('content');
        });

        layui.use(['form', 'layedit', 'laydate'], function () {
            var form = layui.form()
                    , layer = layui.layer
                    , layedit = layui.layedit
                    , laydate = layui.laydate;
            /* 提交表单 */
            form.on('submit(submit_)', function (data) {
                $.ajax({
                    url: "{:addon_url('admin://goods/goods_examine')}",
                    dataType: "json",
                    async: true,
                    data: data.field,
                    type: "POST",
                    success: function (res)
                    {
                        if (res.code != 0)
                        {
                            layer.alert(res.data, {icon: 5});
                        }
                        else
                        {
                            layer.msg(res.data, {
                                icon: 1,
                                time: 2000
                            }, function(){
                                //var url = "/admin/index/goods_list?status=0";
                                // window.open(url, "_parent")
                            });
                        }
                    }
                });
                return false;
            });
        });
    });
</script>